google.load("search", "1");

function OnLoad() {
	// Create a search control
	var searchControl = new GSearchControl();
	searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);

	var options = new GsearcherOptions();
	options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
	options.setRoot(document.getElementById("searchResults"));

	// site restricted web search with custom label
	// and class suffix
	var siteSearch = new GwebSearch();
	siteSearch.setUserDefinedLabel("<?php echo $domain; ?>");
	siteSearch.setUserDefinedClassSuffix("siteSearch");
	siteSearch.setSiteRestriction("<?php echo $domain; ?>");
	searchControl.addSearcher(siteSearch, options);
	
	// Tell the searcher to draw itself and tell it where to attach
	searchControl.draw(document.getElementById("searchForm"));
}

google.setOnLoadCallback(OnLoad);
